Skip to content

ARROW-10192: [Python] Always decode inner dictionaries when converting array to Pandas#8361

Closed
pitrou wants to merge 2 commits into
apache:masterfrom
pitrou:ARROW-10192-struct-of-dict
Closed

ARROW-10192: [Python] Always decode inner dictionaries when converting array to Pandas#8361
pitrou wants to merge 2 commits into
apache:masterfrom
pitrou:ARROW-10192-struct-of-dict

Conversation

@pitrou

@pitrou pitrou commented Oct 6, 2020

Copy link
Copy Markdown
Member

Fix a crash on conversion of e.g. struct of dictionaries.

…g array to Pandas

Fix a crash on conversion of e.g. struct of dictionaries.
@pitrou pitrou requested a review from kszucs October 6, 2020 13:11
@github-actions

github-actions Bot commented Oct 6, 2020

Copy link
Copy Markdown

Comment thread cpp/src/arrow/python/arrow_to_pandas.cc Outdated

# Expected a Series of {field name: field value} dicts
rows_as_tuples = zip(*(child.to_pylist() for child in children))
rows_as_dicts = [dict(zip(names, row)) for row in rows_as_tuples]

@kszucs kszucs Oct 6, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expanded the nested comprehension to make it a bit more readable.

@kszucs kszucs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Antoine! Merging on green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants